package com.zzsy.carosshopprojects.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.king.base.util.ToastUtils;
import com.zzsy.carosshopprojects.activitys.login.LoginAc;
import com.zzsy.carosshopprojects.base.ConfigureFile;
import com.zzsy.carosshopprojects.util.SPUtil;

public class TokenBroadCastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        ToastUtils.showToast(context.getApplicationContext(), "Token已过期,请重新登录");
        SPUtil.getInstance().putBoolean(ConfigureFile.ISLOGIN, false);
        Intent intents = new Intent(context, LoginAc.class);
        intents.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intents);
    }
}
